home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / FAQ < prev    next >
Text File  |  1993-03-15  |  28KB  |  651 lines

  1. This is the Frequent-Asked-Questions (FAQ) file for Expect
  2.  
  3. This file represents questions I've received (with answers I've given)
  4. about subjects that don't fit in the man page for one reason or
  5. another.  In some cases, I've left the original questions.  I suppose
  6. I could've stripped off the headers, but it seems more realistic to
  7. see actual people who've asked the questions.  Thanks to everyone who
  8. asked.
  9.  
  10. Hopefully, no one is embarrassed by seeing their name here.  If
  11. anything, this probably reflects most poorly on me because it shows a
  12. number of ideas other people would like me to add to Expect, that I
  13. haven't.
  14.  
  15. Long rows of hyphens separate the different topics.  In cases where
  16. I've reprinted the original question-letter and my answer, the two are
  17. separated by a short row of hyphens.
  18.  
  19. The papers listed in the README file should also be consulted for highly
  20. technical or philosophical discussion of the implementation, design and
  21. practical application of Expect.
  22.  
  23. -Don
  24.  
  25. Here is a short summary of each question/answer.  You can search for
  26. the number, for example, "#4" once you've found the subject you're
  27. looking for.
  28.  
  29. #1 Why does expect need to be setuid root on Cray?
  30. #2 Why isn't there an expect mailing list?
  31. #3 How do you pronounce "Ousterhout" anyway?  (Or "Libes" for that matter?)
  32. #4 How about distributing a test suite - or - just what are those other
  33.     programs further down in the Makefile? 
  34. #5 Can expect automatically generate a script from watching a session?
  35. #6 What do you think about the Perl rewrite of Expect?
  36. #7 Why should I learn yet another language (Tcl) instead of writing my
  37.     interaction in <a language I already know>.
  38. #8 How come I get "ioctl(set): Inappropriate ..., bye recursed" ...
  39. #9 Do we need to pay or ask for permission to distribute Expect?
  40. #10 Can Expect understand screen-oriented (curses) programs?
  41. #11 Why doesn't Expect kill telnet (or other programs) sometimes?
  42. --------------------------------------------------------------------------
  43. #1
  44. From: libes (Don Libes)
  45. To: u70217@f.nersc.gov (Lori Wong)
  46. Subject: setuid in expect
  47. Date: Thu, 24 Oct 91 16:15:20 EDT
  48.  
  49. >     I have been running expect now under UNICOS 6.1 and CSOS 1.0 (Cray
  50. >Computer Corporation's OS).  The two machines that I am running expect
  51. >on have stringent security features, one of which is to limit setuid
  52. >privileges to specific individuals.  I was wondering if you would be
  53. >kind enough to explain the purpose of the setuid that is needed by expect
  54. >and whether it could be compiled to run without having to have setuid
  55. >privilege?  I know it has to do with spawning and communicating with
  56. >the various spawned tasks, but don't know enough of the details to be
  57. >able to explain why expect specifically needs setuid and whether or not
  58. >it could cause a security problem (could someone use it to enter into
  59. >the system and wreak havoc, for example?).  Right now, I've limited
  60. >the access of expect to my group, but need to know what the security
  61. >implications are if I open it to all users.  I'd appreciate any light
  62. >you can shed on this subject...
  63.  
  64. Root-access is needed to open a pty under Unicos.  Thus, all programs
  65. accessing ptys must be setuid root.  If you do an "ls -l" of programs
  66. like "script", "xterm", etc, you'll see this.
  67.  
  68. I have no idea why this is.  The requirement was probably for security
  69. reasons to begin with, but it has the ironic effect of making more
  70. programs require setuid and therefore greater possibility of errant
  71. setuid programs.
  72.  
  73. In fact, there is one known Unicos bug relating to the way uids are
  74. switched at exec time which requires further special coding.  If you
  75. search for "Cray" in the Expect source you will see significant chunks
  76. of code to get around the problem.
  77.  
  78. I don't know if this reassures you any.  All I can tell you is that a
  79. number of Cray experts have looked into the situation and are happy
  80. with the current implementation of Expect.
  81.  
  82. Don
  83. --------------------------------------------------------------------------
  84. #2
  85. From: libes (Don Libes)
  86. To: dclark@nas.nasa.gov (David R. Clark)
  87. Subject: Mailing list for expect
  88. Date: Mon, 23 Sep 91 18:21:28 EDT
  89.  
  90. >Would be nice if their were an expect mailing list.  I would use it more
  91. >often, and be made aware of other users.  
  92.  
  93. Perhaps I'm too myopic, but I don't see the need for it.  I typically
  94. get two or three expect questions a week, which I answer myself.
  95.  
  96. For one reason or another (usually a bug fix, but often, just revising
  97. the documentation), I update expect about once every two weeks.
  98. Personally, I'd hate being on the other end of something like this.
  99. Who needs patches every two weeks for problems that probably aren't
  100. even relevant to you?
  101.  
  102. >It would be helpful, too, if this served as an area for swapping programs.
  103. >Many of the things that I want to do are done by others already.
  104.  
  105. Send me things that you'd like to distribute.  I'll either include
  106. them with expect or put it in a publicly accessible directory so other
  107. people can get it.  Yes, I know it's not as good as getting notified
  108. via a mailing list, but actually I doubt there's such a need.  The
  109. reality is that most of the programs expect is applied to have
  110. poorly defined interfaces.  There are few portable expect scripts.
  111.  
  112. For example, you can't even write a guaranteed-portable script that
  113. knows what a shell prompt looks like because everyone customizes them!
  114. And the ftp scripts don't work on everyone's ftp because the ftp user
  115. interface is not specified by the standard, so everyone's is
  116. different.  And so on.
  117.  
  118. There is a Tcl newsgroup, comp.lang.tcl, which many expect users read.
  119. It's pretty good for asking questions about Tcl, and there isn't that
  120. much traffic that an occasional Expect question isn't looked upon
  121. favorably.  Indeed, some of the sharpest Tcl hackers read the mailing
  122. list, so I post news about new-releases of expect there first.  The
  123. newsgroup is gatewayed to a mailing list (tcl@sprite.berkeley.edu)
  124. which is further described in the Tcl documentation.
  125.  
  126. Don
  127. --------------------------------------------------------------------------
  128. #3
  129. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  130. To: libes@cme.nist.gov
  131. Subject: Re: pronunciation?
  132. Date: Tue, 29 May 90 21:26:10 PDT
  133.  
  134. Those of us in the family pronounce it "OH-stir-howt", where the
  135. first syllable rhymes with "low", the second with "purr", and the
  136. third with "doubt".  Unfortunately this isn't the correct Dutch
  137. pronounciation for a name spelled this way (someplace along
  138. the line it got misspelled:  it was originally "Oosterhout"), nor
  139. is it what you'd guess if you use common sense.  So, we've gotten
  140. used to responding to almost anything.
  141.  
  142.                     -John-
  143.  
  144. I suppose I should say something in kind.  "Libes" is pronounced
  145. "Lee-bus" with stress on the first syllable.  Like John, though, I've
  146. gotten used to responding to anything close. - Don
  147. --------------------------------------------------------------------------
  148. #4
  149. From: libes (Don Libes)
  150. To: vik@sequent.com
  151. Subject: testing expect
  152. Date: Mon, 17 Sep 90 14:33:51 EDT
  153.  
  154. >This is the header of the shar I have of expect.  The
  155. >following files referred to in the Makefile were not
  156. >included:
  157. >    test/Makefile
  158. >    test/checkall
  159. >    ptytest
  160. >    dumb.c
  161. >    exho.c
  162. >
  163. >Is there a newer shar that has the test programs?
  164.  
  165. No.  These files are part of a test suite that I use.  However, I'm
  166. not distributing them (yet) because they are too fragile.  (One of our
  167. less experienced students wrote them, and he didn't do a very good
  168. job, I'm afraid.  I have to go back and clean them up at some point.)
  169. But it's not high on my priority list.
  170.  
  171. In the meantime, try some of the programs distributed in the test
  172. directory.  They are a strong indication of whether expect works or
  173. not.  If you any problems with them, let me know.
  174.  
  175. Don
  176. --------------------------------------------------------------------------
  177. #5
  178. From: libes (Don Libes)
  179. To: pete@willow24.cray.com
  180. Subject: expect
  181. Date: Fri, 12 Oct 90 17:16:47 EDT
  182.  
  183. >I like "expect" and am thinking of using it to help automate the
  184. >testing of interactive programs.  It would be useful if expect had a
  185. >"watch me" mode, where it "looks over the shoulder" of the user and
  186. >records his keystrokes for later use in an expect script.
  187. >
  188. >(Red Ryder and other Macintosh telecommunications packages offer this
  189. >sort of thing.  You log onto Compuserve once in "watch me" mode, and
  190. >RR keeps track of the keystrokes/prompts.  When you're done you have a
  191. >script that can be used to log onto Compuserve automatically.)   
  192.  
  193. I'd like to see how they do it.  The major problem is when you type
  194. characters, they are invariably echoed.  So if you "interact" with a
  195. system and type "finger", what expect sees is that
  196. you typed 'f',
  197. computer typed 'f',
  198. you typed 'i',
  199. computer typed 'i',
  200. you typed 'n',
  201. computer typed 'n',
  202. ...
  203.  
  204. I.e. expect has no way of knowing that you weren't waiting to see the
  205. computer say 'f', before you typed 'f'.
  206.  
  207. You'd have to handle problems like this, kind of guessing if the
  208. computer is echoing or you are really waiting for the response.  The
  209. system actually doesn't echo exactly what you type, making this even
  210. harder.  And there are other problems: sometimes characters get lumped
  211. together rather than sent separately, sometimes echoing is turned off
  212. for you.
  213.  
  214. If you run expect in debug mode while doing "interact", you'll see
  215. what I mean.
  216.  
  217. Given that you'd have to do such severe editing of an automatically
  218. produced script, I figure writing the script from scratch is easier.
  219.  
  220. Actually, I suggest you used the interact facility (or the UNIX script
  221. program) and just edit the output.  Invariably, you want to change a
  222. lot of text to *s and add alternatives (i.e. a lot of editing) anyway.
  223.  
  224. Do you have to do much editing with scripts that Red Ryder produces?
  225. How does it handle these problems?  Does it support regular
  226. expressions and alternation?  (Obviously, a computer-generated script
  227. can't generate these automatically.)  Do you have to tell it whether
  228. you are full/half-duplex or what kind of line-termination characters
  229. you are using?
  230.  
  231. Is there anything else in Red Ryder that would be useful in expect?
  232.  
  233. >Before I look into adding a "watch me" feature, I thought I should
  234. >ask: has this been done already?
  235.  
  236. You're welcome to give it a shot.  I'd be interested to see what you
  237. come up with.
  238.  
  239. Don
  240.  
  241. ------------------
  242.  
  243. From: (Pete TerMaat) <pete@willow.cray.com>
  244. To: libes@cme.nist.gov (Don Libes)
  245. Subject: Re: expect 
  246. Date: Thu, 17 Jan 91 12:30:01 -0600
  247.  
  248.  > >I like "expect" and am thinking of using it to help automate the
  249.  > >testing of interactive programs.  It would be useful if expect had a
  250.  > >"watch me" mode, where it "looks over the shoulder" of the user and
  251.  > >records his keystrokes for later use in an expect script.
  252.  > >
  253.  > >(Red Ryder and other Macintosh telecommunications packages offer this
  254.  > >sort of thing.  You log onto Compuserve once in "watch me" mode, and
  255.  > >RR keeps track of the keystrokes/prompts.  When you're done you have a
  256.  > >script that can be used to log onto Compuserve automatically.)   
  257.  > 
  258.  > I'd like to see how they do it.  The major problem is when you type
  259.  > characters, they are invariably echoed.
  260.  
  261.  > You'd have to handle problems like this, kind of guessing if the
  262.  > computer is echoing or you are really waiting for the response.
  263.  
  264. That appears to be what Red Ryder does.  It works surprisingly well
  265. for line-oriented things.  It produces unnecessarily lengthy (though
  266. still working) scripts when you make a lot of corrections by
  267. backspacing.  And it isn't suitable for character-oriented things like
  268. editors, where there is no notion of a prompt.
  269.  
  270.  > If you run expect in debug mode while doing "interact", you'll see
  271.  > what I mean.
  272.  
  273. Ah, thanks for the tip.  I hadn't appreciated the problem.
  274.  
  275.  > Actually, I suggest you used the interact facility (or the UNIX script
  276.  > program) and just edit the output.  Invariably, you want to change a
  277.  > lot of text to *s and add alternatives (i.e. a lot of editing) anyway.
  278.  
  279. I'm working with text editors and document viewers, so for every
  280. character typed there can be a lot of output.  It wouldn't make sense
  281. for me to wade through all that output and trim it down.
  282.  
  283. Writing the scripts from scratch, as you suggested, is currently my
  284. best approach.  I'm also experimenting with a command which logs just
  285. the input.
  286.  
  287.  > Do you have to do much editing with scripts that Red Ryder produces?
  288.  
  289. Here's an example from Microphone (another Macintosh communications
  290. program), which is not as sophisticated in its watchme mode as Red
  291. Ryder.  I had it watch me while I typed "echo this is a test" to the
  292. shell.  It's pretty stupid, but (to my surprise) the script
  293. nevertheless works, without any editing.
  294.  
  295.     6   Wait for Text  "% "
  296.     7   Send Text String  "echo"
  297.     8   Wait for Text  "% ech"
  298.     9   Send Text String  " "
  299.     10  Wait for Text  "echo "
  300.     11  Send Text String  "this"
  301.     12  Wait for Text  "o thi"
  302.     13  Send Text String  " "
  303.     14  Wait for Text  "this "
  304.     15  Send Text String  "is a "
  305.     16  Wait for Text  "is a "
  306.     17  Send Text String  "te"
  307.     18  Wait for Text  " a te"
  308.     19  Send Text String  "st"
  309.     20  Wait for Text  " test"
  310.     21  Send Text String  "^M"
  311.     22  Wait for Line Containing  " test"
  312.  
  313. Here's an example of the same thing done with Red Ryder watching.
  314. Much better!
  315.  
  316.     PROMPT % 
  317.     PAUSE
  318.     TYPE echo this is a test^M
  319.     PROMPT % 
  320.  
  321. Red Ryder appears to keep track of what was typed and eliminate that
  322. from any possible prompts.  As you pointed out, what was typed is not
  323. always what was printed, but in my experience (mostly using it to dial
  324. up to UNIX sites) this hasn't been a problem.
  325.  
  326.  > How does it handle these problems?  Does it support regular
  327.  > expressions and alternation?  (Obviously, a computer-generated script
  328.  > can't generate these automatically.)  
  329.  
  330. No, just literals.  Red Ryder won't go back further than the last line
  331. of output, which usually works better than Microphone's more generous
  332. approach. 
  333.  
  334.  > Do you have to tell it whether you are full/half-duplex or what
  335.  > kind of line-termination characters you are using?
  336.  
  337. Since it's a communications program it already has the info, but I
  338. don't know that it uses this information when it creates the scripts.
  339.  
  340.  > Is there anything else in Red Ryder that would be useful in expect?
  341.  
  342. Good question.  I think expect has these programs beat though, with
  343. the exception of a watchme feature.  A visual interface would be nice,
  344. as one thing that I miss from Red Ryder is the status line, which
  345. tells you the current command.  (I know you can sort of simulate this
  346. by tracing the TCL code.)  Some of my expect scripts are long and it's
  347. helpful to know what they are sending/expecting when they pause/hang.
  348. As long as I'm dreaming, it would also be nice if I could single-step
  349. through a script by pressing a "single-step" button.  I guess these
  350. are more TCL issues than expect issues.
  351.  
  352. Microphone has a nice interface for novices.  You can write a script
  353. with very little typing by pointing and clicking from menus of
  354. keywords.  Red Ryder's language is less verbose and probably more
  355. powerful, but neither is as powerful/flexible as expect/TCL.
  356.  
  357.  > >Before I look into adding a "watch me" feature, I thought I should
  358.  > >ask: has this been done already?
  359.  > 
  360.  > You're welcome to give it a shot.  I'd be interested to see what you
  361.  > come up with.
  362.  
  363. Since it's not quite so useful for character-oriented editors as for
  364. line-oriented things, I've decided for now just to write the scripts
  365. from scratch.
  366.  
  367. I'll say again that I like the tool a lot--nice work!  There are other
  368. people here using it for things like the testing of ksh, which
  369. responds differently to signals when not used interactively.
  370.  
  371. I have some mods to make expect run on a Cray.  I was sort of waiting
  372. to see if the mods are Cray-specific or System V specific before
  373. forwarding them, but if you would like to incorporate them right away
  374. I will send them.
  375.  
  376. -- Pete
  377.  
  378. --------------------------------------------------------------------------
  379. #6
  380. From: libes@cme.nist.gov (Don Libes)
  381. Subject: Re: Expect.pl, alpha release
  382. Date: 2 Nov 90 03:06:40 GMT
  383.  
  384. In article <1990Nov2.003228.22744@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes:
  385. >The motivation for writing this package is the fact
  386. >that Don Libes doesn't like Perl. :-)
  387.  
  388. I've never said anything like that, nor is it true (although I will admit
  389. that I've had a lot of trouble learning Perl.)  Fact is, I've written
  390. several Perl hacks, at least one of which is used daily at my site.
  391.  
  392. >The matchup of expect<->tcl and expect.pl<->Perl made for some weird
  393. >design tradeoffs.  I may start from mostly scratch and do everything
  394. >right.  That is probably why I hesitate to implement the rest of the
  395. >functions... they really don't fit in a Perl environment.
  396.  
  397. Actually, I discussed these issues with several people during the
  398. development of expect.  The approach I took effectively sealed off the
  399. user from the underlying C implementation, substituting the more shell-
  400. like Tcl language and reducing the ability to screw themselves somehow.
  401.  
  402. In the approach you took, the user language IS Perl, which provides
  403. incredible power and flexibility.  The primary disadvantage is that
  404. the user may have to learn Perl, which is hard.
  405.  
  406. Also, as you noticed, some of the features (like logging) are a problem
  407. for Perl.  Oh, and as you suspected, recursive invocations are useful -
  408. consider writing scripts that are half automated and half interactive,
  409. like the fsck script I showed at the LISA conference.
  410.  
  411. Please don't get me wrong.  I think Perl is very useful.  I desperately
  412. want a copy of your book.  And I consider it a compliment that you
  413. followed my implementation as faithfully as you did.  Though, I did
  414. think some of your Perl code pretty weird!
  415.  
  416. Actually, in my USENIX paper I stated that I fully expected someone to
  417. incorporate the expect primitives into a shell, Perl, whatever.  I was
  418. just showing proof of concept.  It just happened to turn out to be
  419. worth keeping around.
  420.  
  421. In fact, I owe a lot for it to John Ousterhout who wrote Tcl.
  422.  
  423. Don Libes          libes@cme.nist.gov      ...!uunet!cme-durer!libes
  424. ------------------
  425. Article 10362 in comp.lang.perl:
  426. From: merlyn@ora.com (Randal L. Schwartz)
  427. Subject: Re: perl4.035 & Solaris2.1 & sockets problem
  428. Message-ID: <MERLYN.93Feb18080120@romulus.reed.edu>
  429. Date: 18 Feb 93 16:01:26 GMT
  430. References: <110637@bu.edu> <1993Feb17.221430.19168@jpl-devvax.jpl.nasa.gov>
  431. Organization: Stonehenge Consulting Services; Portland, Oregon, USA
  432. Lines: 26
  433. In-Reply-To: dnoble@hobbs's message of 17 Feb 93 22:14:30 GMT
  434.  
  435. >>>>> In article <1993Feb17.221430.19168@jpl-devvax.jpl.nasa.gov>, dnoble@hobbs (David Noble) writes:
  436. David> Check to see if 'sys/socket.ph' is required by the script. If it's not
  437. David> there, the script may have hard-coded some constants that are different
  438. David> under Solaris. Reminds me of some code in chat2.pl:
  439. David>         unless (socket(S, 2, 1, 6)) {
  440. David>                 # XXX hardwired $AF_SOCKET, $SOCK_STREAM, 'tcp'
  441. David>                 # but who the heck would change these anyway? (:-)
  442.  
  443. Yup.  I've been bitten by this code (*my* code) myself when I moved to
  444. a blecchy sysV environment.
  445.  
  446. All because I had used chat2 on only the few boxes (all BSD-derived)
  447. that I had access to at the time, and I was too lazy to run h2ph. :-)
  448.  
  449. *Someday* soon, after the 5.0 camel update, and Learning Perl hits the
  450. stands, I'm going to rewrite the chat2 stuff to make it portable, add
  451. some documentation, and then release it (finally!) as a Beta release.
  452. (It's still just an alpha, folks!  Enough stuff to make it work for
  453. *my* needs, but not really meant as a general tool yet!... sigh.)
  454.  
  455. print "Just another Perl [book and class, but not lib code :-] hacker,"
  456. --
  457. Randal L. Schwartz
  458. --------------------------------------------------------------------------
  459. #7
  460. From: libes (Don Libes)
  461. To: Aamod Sane <sane@cs.uiuc.edu>
  462. Cc: libes
  463. Subject: Re: Expect, Tcl, programmed dialogue etc.
  464. Date: Mon, 2 Sep 91 15:47:14 EDT
  465.  
  466. >    >>A friend told me about "expect". But then, I have to know the
  467. >    >>idiocies of "tcl". I would like to know if there is an alternative
  468. >    >>to expect that is also useful in other places, so that I do not
  469. >    >>have to spend time getting used to tcl for just this one tool.
  470. >
  471. >    Your reasoning is shortsighted.  Tcl is a language that can be used in
  472. >    other applications.  It won't be a waste of your time to learn it.
  473. >
  474. >I have nothing against tcl as such.
  475. >The reluctance to learn it comes mainly from the feeling that half my
  476. >life seems to be spent learning new languages that differ very little
  477. >from existing ones, and differ in annoying little details at that.
  478. >To add to the misery, every implementation has its own
  479. >idiosyncracies...:-(
  480.  
  481. Ironically, Tcl was written specifically to halt this very problem.
  482.  
  483. The author recognized that every utility seems to have its own
  484. idiosyncratic .rc file or programming language.  Tcl was designed as a
  485. general-purpose language that could be included with any utility, to
  486. avoid having everyone hack up their own new language.
  487.  
  488. In this context, your statements to the newsgroup do Tcl a great
  489. disservice.
  490.  
  491. Don
  492. ------------------------------------------------------------------------
  493. #8
  494. From: james@Solbourne.COM (James B. Davis)
  495. To: libes@cme.nist.gov
  496. Subject: How come I get "ioctl(set): Inappropriate ..., bye recursed" ...
  497. Date: Tue, 10 Dec 91 10:47:21 MST
  498.  
  499. Every time I ^C out of a expect script run I get:
  500.  
  501. ioctl(set): Inappropriate ioctl for device
  502. bye recursed
  503.  
  504. Is this standard or am I doing something wrong?
  505.  
  506. james@solbourne.com
  507. ---------------
  508. From: Michael Grant <mgrant@xdr.ncsl.nist.gov>
  509. Subject: Re: How come I get "ioctl(set): Inappropriate ..., bye recursed" ...
  510. Date: Tue, 10 Dec 91 16:05:01 EST
  511.  
  512. The problem was that I hadn't run the fixincludes shellscript and
  513. recompiled gcc with itself during gcc installation.  I recompiled gcc
  514. with itself, then ran the fixincludes script, the messages went away.
  515.  
  516. Michael Grant
  517.  
  518. --------------------------------------------------------------------------
  519. #9
  520. From: libes (Don Libes)
  521. To: Mohammad Reza Jahanbin <mrj@CIS.Prime.COM>
  522. Subject: Copyright Question.
  523. Date: Tue, 26 Jan 93 23:46:24 EST
  524.  
  525. Mohammad Reza Jahanbin writes:
  526. >Before anything let me thank you on behalf of ComputeVision R&D for
  527. >putting so much effort into expect. Part of CV has been using expect
  528. >for the past two years or so to build variety of tools including an
  529. >automated testbed for a product.
  530. >
  531. >CV is currently considering shipping the automated testbed to some of its
  532. >retailers, to enable them to perform their own tests before distributing
  533. >the product.
  534. >
  535. >The Question is, are we allowed to ship expect? Do we need to ask
  536. >anyone for permission? Do we need to say or write anything in the
  537. >documentation? Do we need to pay for it?
  538. >
  539. >I have not been able to find any copyright (or indeed copyleft) notices
  540. >in the usual expect distribution. Would you be able to clarify our position.
  541.  
  542. Sorry to delay in responding.  I sent your request to my management
  543. and they had to discuss it (if they didn't, there would be no reason
  544. to pay them).  While they continue to discuss it, I can tell you
  545. informally the gist of what they will eventually say:
  546.  
  547. You are allowed to do just about anything with Expect.  You can even
  548. sell it.  You need not ask our permission.  You need not pay for it.
  549. (It is my understanding that your tax dollars, in effect, already have
  550. paid for it.)
  551.  
  552. You cannot claim that you wrote it (since this would be a lie), nor
  553. can you attempt to copyright it (this would be fruitless as it is a
  554. work of the US government and therefore not subject to copyright).
  555.  
  556. NIST would appreciate any credit you can give for this work.  One line
  557. may suffice (as far as I'm concerned) although there should be
  558. something to the effect that this software was produced for research
  559. purposes.  No warantee, guarantee, liability is implied.
  560.  
  561. My management would appreciate it if you sent a letter on your company
  562. letterhead suitably praising Expect and briefly describing how it has
  563. helped your business.  Send this to the following individuals:
  564.  
  565. John Lyons, Director
  566. NIST
  567. Admin Bldg, Rm A-1134
  568. Gaithersburg, MD 20899
  569.  
  570. John Simpson, Director, Manufacturing Engineering Laboratory
  571. NIST
  572. Bldg 220, Rm B-322
  573. Gaithersburg, MD 20899
  574.  
  575. Howard Bloom, Factory Automation Systems Division
  576. NIST
  577. Bldg 220, Rm A-127
  578. Gaithersburg, MD 20899
  579.  
  580. Jeane Ford, Product Data Engineering Group
  581. NIST
  582. Bldg 220, Rm A-127
  583. Gaithersburg, MD 20899
  584.  
  585.  
  586. If you feel more indebted than a letter can express, your company can
  587. sign a CRADA (Cooperative Research and Development Agreement) with
  588. NIST.  This is a contract that can be customized as you like.
  589. Typically, CRADA's state that we give you explicit permission to
  590. distribute or commercialize our code, and that we are willing not to
  591. divulge any company secrets you tell us.  CRADA's can also state
  592. that we will share further developments with you, or that you are
  593. giving us money or software, or even just sending us bugs, fixes and
  594. experiences.
  595.  
  596. These contracts are looked upon by Congress as an indication that we
  597. are helping American industry (i.e., doing our job).  Even though they
  598. seem vague and almost pointless, they essentially are brownie points
  599. for NIST when it comes to asking for funding from Congress each year.
  600.  
  601. I hope this has answered your questions.  Let me know if you have
  602. further questions.
  603.  
  604. Don
  605. ----------------------------------------------------------------------
  606. #10 Can Expect understand screen-oriented (curses) programs?
  607.  
  608. Mark Weissman (weissman@gte.com) and Christopher Matheus modified a
  609. version of Expect that has a built-in Curses emulator with commands to
  610. expect patterns by rows and columns.  It even understands patterns
  611. such as highlight and underscore.
  612.  
  613. This program is called Expecterm and can ftp'd from
  614. harbor.ecn.purdue.edu (128.46.128.76) or ftp.ibp.fr (132.227.60.2) as
  615. /tcl/extensions/expecTerm1.0beta.tar.Z
  616.  
  617. Subject to experience, Expecterm is likely to change rapidly (the user
  618. interface, especially) so we have not integrated this into the
  619. main-line of Expect.  When Expecterm settles down, it will be combined
  620. with Expect itself.
  621.  
  622. ----------------------------------------------------------------------
  623. #11 Why doesn't Expect kill telnet (or other programs) sometimes?
  624.  
  625. To: Karl.Sierka@Labyrinth.COM
  626. Subject: Re: need help running telnet expect script from cron on sunos 4.1.3
  627. --text follows this line--
  628. karl.sierka@labyrinth.com writes:
  629. >       The only problem I am still having with the script I wrote is that
  630. >    the telnet does not seem to die on it's own, unless I turn on debugging.
  631.  
  632. Actually, Expect doesn't explicitly kill processes at all.  Generally,
  633. processes kill themselves after reading EOF on input.  So it just seems
  634. like Expect kills all of its children.
  635.  
  636. >    I was forced to save the pid of the spawned telnet, and kill it with an
  637. >    'exec kill $pid' in a proc that is hopefully called before the script
  638. >    exits. This seems to work fine, but it makes me nervous since omnet
  639. >    charges for connect time, and leaving a hung telnet lying around could
  640. >    get expensive. I warned the rest of the staff so that they will also be
  641. >    on the lookout for any possible hung telnets to omnet.
  642.  
  643. The problem is that telnet is not recognizing EOF.  (This is quite
  644. understandable since real users can't actually generate one from the
  645. telnet user interface.)  The solution is to either 1) explicitly drive
  646. telnet to kill itself (i.e., a graceful logout) followed by "expect
  647. eof" or 2) "exec kill" as you are doing.
  648.  
  649. Don
  650.  
  651.